<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业4</title>
</head>

<body>
    <pre>
        4、写一个正则输出以下字符串中所有QQ号
        var str="我QQ号为:407762121, 我弟的QQ号为13445983";
        QQ号的规则：第一个字符不能是0，长度4~11
    </pre>

    <script>
        var str = "我QQ号为:407762121, 我弟的QQ号为13445983";
        var a = /[1-9]\d{4,10}/g;
        var c = str.match(a);
        console.log(c);
    </script>
</body>

</html>